import { ADD_PERSON } from '../constant';

const initState = [{ id: '0', name: 'tome', age: 18 }];
export default function personReducer(preState = initState, action) {
    const { type, data } = action;
    console.log(type, data);
    switch (type) {
        case ADD_PERSON:
            return [data, ...preState];

        default:
            return preState;
    }
}
